package thread;

/**
 * 线程 run和start区别
 * @Author: Crystal
 * @Date: 2019/5/13 14:56
 **/
public class ThreadTest {

    private static void attack() {
        System.out.println("Fight");
        System.out.println("Current Thread is : " + Thread.currentThread().getName());
    }

    public static void main(String[] args) {
        Thread t = new Thread(){
            public void run() {
                attack();
            }
        };
        System.out.println("start#Current Thread is : " + Thread.currentThread().getName());
        t.start();

        Thread t2 = new Thread(){
            public void run() {
                attack();
            }
        };
        System.out.println("run# Current Thread is : " + Thread.currentThread().getName());
        t2.run();
    }

}
